﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using Modelo;

namespace Interface
{
    /// <summary>
    /// Interaction logic for BuscarCliente.xaml
    /// </summary>
    public partial class BuscarCliente : UserControl
    {
        Cliente cliente;
        List<Cliente> list = new List<Cliente>();
        public BuscarCliente()
        {
            InitializeComponent();
            dataGrid1.ItemsSource = BaseDatos.BDCliente.DevolverTodos();
        }

        private void dataGrid1_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            cliente = (Cliente)dataGrid1.SelectedItem;
        }

        private void dataGrid1_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            //if (dataGrid1.SelectedIndex > 1)
            //{
            //    EditarCliente ed = new EditarCliente(cliente);
            //    ed.ShowDialog();

            //}
        }

        private void button2_Click(object sender, RoutedEventArgs e)
        {
            //if (dataGrid1.SelectedIndex > 1)
            //{
            //    EditarCliente ed = new EditarCliente(cliente);
            //    ed.ShowDialog();

            //}
        }

        private void button1_Click(object sender, RoutedEventArgs e)
        {
            if (dataGrid1.SelectedIndex > 1)
            {
                EditarCliente ed = new EditarCliente(cliente);
                ed.ShowDialog();

            }
        }


    }
}
